package com.ruoyi.framework.mybatisplus.util;

/**
 * @author yql
 * @describe TypeUtils
 * @date 2023/3/10 9:08
 */

public class TypeUtil extends org.apache.commons.lang3.reflect.TypeUtils {

    public static Boolean isBasisType(Class clazz) {
        return clazz.equals(byte.class) || clazz.equals(short.class) || clazz.equals(int.class) || clazz.equals(long.class) ||
                clazz.equals(float.class) || clazz.equals(double.class) || clazz.equals(char.class) || clazz.equals(boolean.class) ||
                clazz.equals(Integer.class) || clazz.equals(Byte.class) || clazz.equals(Short.class) || clazz.equals(Long.class) ||
                clazz.equals(Float.class) || clazz.equals(Double.class) || clazz.equals(Character.class) || clazz.equals(Boolean.class);
    }

    public static Boolean isBasisTypeAndString(Class clazz) {
        return isBasisType(clazz) || String.class.equals(clazz);
    }
}
